#ifndef UTILITY_FUNCTIONS_HPP_INCLUDED
#define UTILITY_FUNCTIONS_HPP_INCLUDED

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>

extern void error_and_terminate(const char *s);
extern std::string UCASE(std::string s);
extern std::string LCASE(std::string s);
extern std::string LTRIM(std::string s);
extern std::string RTRIM(std::string s);
extern std::string TRIM(std::string s);
extern std::string STR(double d);
extern double VAL(const std::string &s);

extern void usage();

template <class Tcontains>
bool contains(Tcontains elem, std::vector<Tcontains> vect)  // similar to java's vector's member function
{
    for(unsigned i = 0; i < vect.size(); i++)
    {
        if(vect[i] == elem)
        {
            return true;
        }
    }
    return false;
}



#endif // UTILITY_FUNCTIONS_HPP_INCLUDED
